﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Entity.DomainModels.ProductionManagement;
using VOL.Smartmanufacturing.Infrastructure;
using VOL.Smartmanufacturing.IServices.ProductionManagement;

namespace VOL.Smartmanufacturing.Services.ProductionManagement
{
    /// <summary>
    ///删除设备台账
    /// </summary>
    public class DelEquipmentLedger : IDelEquipmentLedger
    {
        private readonly IBaseRepository<EquipmentLedgerModel> _delbaseRepository;

        public DelEquipmentLedger(IBaseRepository<EquipmentLedgerModel> delbaseRepository)
        {
            _delbaseRepository = delbaseRepository;
        }
        public async Task<int> DelEquipmentLedgerAsync(int id)
        {
            var delequipments = await _delbaseRepository.FindAsync(id);
            if (delequipments == null)
            {
                return 0;
            }
            return await _delbaseRepository.Remove(delequipments);
        }
    }
}
